package com.example.beshy;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class ShyActivity extends BaseActivity {

    private static final String TAG = "ShyActivity";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.d(TAG, "onCreate: " + this);
        Log.d(TAG, "Task id is " + getTaskId() );

        if (savedInstanceState != null) {
            String tempData = savedInstanceState.getString("data_key");
            Log.d(TAG, tempData);
        }

        setContentView(R.layout.shy_layout);

        Button shyBtn1 = (Button) findViewById(R.id.shy_btn_1);

        shyBtn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(ShyActivity.this, SecondActivity.class);
//                startActivity(intent);

                SecondActivity.actionStart(ShyActivity.this, "abc", "efg");
            }
        });
    }

    @Override
    protected void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);
        String tempData = "Something you just typed";
        outState.putString("data_key", tempData);
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d(TAG, "onRestart: " + this);
    }
}
